package com.android.loveandhate.detector.image;

import android.graphics.PointF;
import android.media.FaceDetector;
import android.util.Log;

public class Face {
	private float distance;
	private float confidence;
    private PointF middlePoint;
    
	public Face( FaceDetector.Face face, boolean DEBUG ) {
		PointF eyesMP = new PointF();
        face.getMidPoint(eyesMP);
        confidence = face.confidence();
        distance = face.eyesDistance();
        middlePoint = eyesMP;
        
        if (DEBUG) {
        	Log.i("Face",
        			face.confidence() + " " + face.eyesDistance() + " "
        			+ "Pose: ("+ face.pose(FaceDetector.Face.EULER_X) + ","
        			+ face.pose(FaceDetector.Face.EULER_Y) + ","
        			+ face.pose(FaceDetector.Face.EULER_Z) + ")"
        			+ "Eyes Midpoint: ("+middlePoint.x + "," + middlePoint.y +")"
        	);
        }
	}
	
	public float getDistance(){
		return distance;
	}
	
	public PointF getMiddlePoint() {
		return middlePoint;
	}
	
	
}
